๐Ÿ“ˆ

Monte Carlo CUDA

American Options Pricing Engine

GPU-accelerated Quasi-Monte Carlo with Sobol sequences & Brownian Bridge conditioning

CUDA C++ OpenMP Quasi-Monte Carlo Sobol Sequences Brownian Bridge Black-Scholes
~400ร—
GPU vs Serial Speedup
1M
Max Paths (GPU)
5
Backends

github.com/sidx007/Monte-Carlo-cuda

Overview

What is Monte Carlo CUDA?

A reimplementation of Cvetanoska & Stojanovski's HPC paper on American option pricing, extended with true Quasi-Monte Carlo backends. American calls are priced as Bermudan options using GBM path simulation with backward induction โ€” sharing one unified math core across all five backends.

Serial CPU

Reference implementation using LCG pseudo-random number generator. Single-threaded baseline for correctness verification and timing comparison.

OpenMP Parallel

Multi-core CPU parallelization with OpenMP. Both standard LCG and QMC (Sobol + Brownian Bridge) variants, scaling across all available CPU threads.

CUDA GPU

Full GPU acceleration โ€” each thread simulates an independent path. Per-thread LCG seeded with (path_id+1)*1234567u for reproducible independent streams.

QMC CUDA

True low-discrepancy QMC on GPU โ€” Sobol sequences with Brownian Bridge conditioning for better space-filling than pseudo-random, cutting variance at the same N.

Algorithm

Pricing Pipeline

Input โ€” Sโ‚€, K, r, ฯƒ, T, m exercise points, N simulation paths
โ†“
Forward Simulate N GBM Paths โ€” LCG + Moro Inverse CND for normal shocks ยท each path independent
โ†“
Backward Induction (Bermudan Approximation)
At each node t intrinsic = max(S-K, 0) value = max(intrinsic, disc. continuation)
โ†“
QMC Path: Sobol โ†’ Brownian Bridge โ†’ GBM shocks
Moro Inverse CND
Normal sampling
BS Validation
Hull textbook
โ†“
Average & Discount time-zero values โ†’ Option Price
Benchmarks

Timing Across Backends

N=100k paths โ€” relative speed

Serial CPU1ร—
OpenMP (16 cores)~14ร—
QMC OpenMP~16ร—
CUDA GPU~380ร—
QMC CUDA~400ร—

Path sweep โ€” pricing error vs N

N (paths) Serial CUDA QMC CUDA
10k ~0.8 ~0.8 ~0.3
100k ~0.25 ~0.25 ~0.08
500k ~0.12 ~0.12 ~0.02
1M slow fast best
QMC advantage: Sobol low-discrepancy sequences fill the sample space more uniformly than pseudo-random LCG โ€” cutting absolute price error by ~3ร— at the same N.
Usage

Build & Run

Builds with CMake. CUDA is optional โ€” if not installed the GPU executables are silently skipped. Default arch is sm_80 (A100); change CUDA_ARCHITECTURES for your GPU.

sm_75 Turing ยท sm_86 Ampere consumer ยท sm_89 Ada ยท sm_90 Hopper
Validate suite: BS vs Hull textbook, Moro CND at 0.975, American โ‰ฅ European, monotonic m convergence
Each benchmark prints a table over N โˆˆ {10, 100, 1k, 10k, 100k, 200k, 300k, 500k, 1M} with timing and price
CUDA kernel uses per-thread stack of 64 โ€” supports up to mโ‰ค63 exercise points
$ mkdir -p build && cd build $ cmake .. -DCMAKE_BUILD_TYPE=Release $ make -j # Validate correctness $ ./validate # Run each backend $ ./american_serial $ ./american_omp $ ./american_qmc_omp $ ./american_cuda # CUDA required $ ./american_qmc_cuda # CUDA required # Example output (N=100k, m=10) # Backend Price Time(ms) # Serial 7.423 1840.2 # OpenMP 7.418 131.4 # CUDA 7.421 4.8 # QMC CUDA 7.412 4.6